package com.ssm.dto;

import com.ssm.entity.Appointment;
import com.ssm.enums.AppointStateEnum;

/**
 * @author mayn
 * @title: AppointExecution
 * @projectName ssmTest
 * @description: 封装预约执行后的结果
 * @date 2019/8/6 11:17
 */
public class AppointExecution {
    private long bookId;//图书id
    private int state;//秒杀预约结果状态
    private String stateInfo;//状态标识
    private Appointment appointment;//预约成功对象

    public AppointExecution() {
    }

    // 预约失败的构造器
    public AppointExecution(long bookId, AppointStateEnum stateEnum) {
        this.bookId = bookId;
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
    }

    // 预约成功的构造器
    public AppointExecution(long bookId, AppointStateEnum stateEnum, Appointment appointment) {
        this.bookId = bookId;
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
        this.appointment = appointment;
    }
}
